home *** CD-ROM | disk | FTP | other *** search
- Path: news.ultranet.com!usenet
- From: kbrady@ultranet.com (Ken Brady)
- Newsgroups: comp.lang.c,comp.lang.c++
- Subject: Speed of C program vs. Speed of Pascal program
- Date: 9 Mar 1996 17:31:05 GMT
- Organization: UltraNet Communications, Inc.
- Message-ID: <4hsf8p$c5d@caesar.ultra.net>
- NNTP-Posting-Host: kbrady.ultranet.com
- X-Newsreader: NeoLogic News for OS/2 [version: 4.2 UNREGISTERED 28 days remaining]
-
- I recently began learning to program in C/C++ after many years
- of using Borland Turbo Pascal (v6.0). I have been porting a data analysis
- program into C/C++, and notice that a subroutinefor reading large tables of
- numbers (ASCII) and loading these numbers into (binary) arrays proceeds much
- more rapidly in my C program than in my Pascal program. For one large table,
- my Pascal program requires about 10 s to load the table, while the C program
- loads it in less than 1 second.
-
- The I/O algorithms in these programs are essentially identical. I deduce
- that the C atof function is much faster than the Pascal Val function. Is
- this typical?
-
- My C/C++ compiler is Watcom 10.5, running under OS/2.
-
- kbrady@ultranet.com
-
-
-